package com.dream.autoconfig.controller;

import com.dream.autoconfig.config.ProjectConfig;
import com.dream.autoconfig.dto.ConfigDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/config")
public class ConfigController {

    @Autowired
    private ProjectConfig config;

    @GetMapping("/info")
    public ConfigDTO getConfigInfo() {
        return new ConfigDTO(
                config.getName(),
                config.getVersion(),
                config.getDescription()
        );
    }
} 